package com.minglv.mini.service.impl;

import com.minglv.mini.domain.IntegralLog;
import com.minglv.mini.mapper.CheeseLogMapper;
import com.minglv.mini.mapper.IntegralLogMapper;
import com.minglv.mini.service.IIntegralLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
//@DataSource(DataSourceType.SLAVE)
public class IntegralLogServiceImpl implements IIntegralLogService {

    @Autowired
    private IntegralLogMapper integralLogMapper;

    @Resource
    private CheeseLogMapper cheeseLogMapper;

    @Override
//    @DataSource(DataSourceType.SLAVE)
    public List<Map> getCheeseList(Integer type) {
        return cheeseLogMapper.getCheeseList(type);
    }

    @Override
//    @DataSource(DataSourceType.SLAVE)
    public List<Map> getList(Integer type) {
        return integralLogMapper.getList(type);
    }

    /**
     * 查询【请填写功能名称】
     *
     * @param id 【请填写功能名称】主键
     * @return 【请填写功能名称】
     */
    @Override
    public IntegralLog selectIntegralLogById(Long id)
    {
        return integralLogMapper.selectIntegralLogById(id);
    }

    /**
     * 查询【请填写功能名称】列表
     *
     * @param integralLog 【请填写功能名称】
     * @return 【请填写功能名称】
     */
    @Override
    public List<IntegralLog> selectIntegralLogList(IntegralLog integralLog)
    {
        return integralLogMapper.selectIntegralLogList(integralLog);
    }

    /**
     * 新增【请填写功能名称】
     *
     * @param integralLog 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int insertIntegralLog(IntegralLog integralLog)
    {
        return integralLogMapper.insertIntegralLog(integralLog);
    }

    /**
     * 修改【请填写功能名称】
     *
     * @param integralLog 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int updateIntegralLog(IntegralLog integralLog)
    {
        return integralLogMapper.updateIntegralLog(integralLog);
    }

    /**
     * 批量删除【请填写功能名称】
     *
     * @param ids 需要删除的【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteIntegralLogByIds(Long[] ids)
    {
        return integralLogMapper.deleteIntegralLogByIds(ids);
    }

    /**
     * 删除【请填写功能名称】信息
     *
     * @param id 【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteIntegralLogById(Long id)
    {
        return integralLogMapper.deleteIntegralLogById(id);
    }
}
